#define _CRT_SECURE_NO_WARNINGS 1
#include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
    int citys(vector<vector<int> >& m)
    {
        for (auto& a : m)
        {
            for (auto& b : a)
            {
                cerr << b << " ";
            }
            cerr << endl;
        }
        cerr << "-----------" << endl;
        vector<int> dp(m.size(), 1);
        for (int i = 1;i < dp.size();i++)
        {
            bool flag = false;
            for (int j = 0;j < i;j++)
            {
                if (m[i][j] == 1)
                {
                    flag = true;
                }
            }
            if (flag)
                dp[i] = dp[i - 1];
            else
                dp[i] = dp[i - 1] + 1;
        }
        for (auto& a : dp)
        {
            cerr << a << " ";
        }
        cerr << endl;
        cerr << dp[dp.size() - 1] << endl;
        return dp[dp.size() - 1];
    }
};